import React, { Component } from 'react'

class Demo1 extends Component {
    state = {
        count: 0,
    }
    render() {
        return (
            <div>
                <p>您点击了 {this.state.count} </p>
                <button onClick={this.setCount.bind(this)}>加</button>
            </div>
        )
    }
    setCount() {
        this.setState({
            count: this.state.count + 1,
        })
    }
}

export default Demo1
